<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<%@ page import="net.lwf.web.constant.IWebConstant, net.lwf.common.constant.ICommonConstant"%>

	<html:form action="/home">
	<div onKeyPress="return submitPreferences(event, '/home.do?action=save')">
		<script>
		    //setFocus('btnSubmit');
			document.haform.btnSubmit.focus();
			function setFocus(object) {
				var radioobj = eval('document.' + getFormName() + 'preferences.level');
				radioobj[1].focus();
			}
		</script>	
	
	
		<table align="center">
          <logic:equal name="haform" property="showPreferences" value="true">
	       <tr>
	           <td align="center" class="description-small">
	           		<h1>Welcome! to my teaching buddy.</h1>
	           		<p>Please be informed that this application works well with <b>Firefox</b> browser.</p>
	           		<p>Please enter your preferences.</p>
	           </td>
	       </tr>           
            <tr>
               <td colspan="3">&nbsp;</td>
            </tr>
            <tr>
               <td colspan="3">
               	  
                  <fieldset>
                  	 <legend>Enter/Change your preferences</legend>
                  	 <table>
                  	    <tr>
                  	       <td colspan="2">&nbsp;</td>
                  	    </tr>                  	 
                  	    <tr>
                  	       <td class="formLabel">Are you a pre-schooler?</td>
                  	       <td class="formValue">
                  	          <html:radio property="preferences.level" value="<%=IWebConstant.PRE_SCHOOL%>" /> &nbsp;&nbsp;Yes
                  	          <html:radio property="preferences.level" value="<%=IWebConstant.NOT_PRE_SCHOOL%>" /> &nbsp;&nbsp;No
                  	       </td>
                  	    </tr>
                  	    <tr>
                  	       <td colspan="2">&nbsp;</td>
                  	    </tr>
                  	    <tr>
                  	       <td class="formLabel">Do you want to see the answer?</td>
                  	       <td class="formValue">
                  	          <html:radio property="preferences.seeAnswer" value="<%=ICommonConstant.YES%>"/> &nbsp;&nbsp;Yes
                  	          <html:radio property="preferences.seeAnswer" value="<%=ICommonConstant.NO%>"/> &nbsp;&nbsp;No
                  	       </td>
                  	    </tr>
                  	    <tr>
                  	       <td colspan="2">&nbsp;</td>
                  	    </tr>
                  	    <tr>
                  	       <td class="formLabel">Attempts to answer a question:</td>
                  	       <td>
		                      <html:select property="preferences.attempts">
		                          <html:options property="lstAttempts"/>
		                      </html:select>                  	       
                  	       </td>
                  	    </tr>
                  	    <tr>
                  	       <td colspan="2">&nbsp;</td>
                  	    </tr>
                  	    <tr>
                  	       <td colspan="2" align="right">
                  	          <input type="button" name="btnSubmit" value="Submit" onClick="submitPreferences1('/home.do?action=save')"/>
                  	       </td>
                  	    </tr>
                  	 </table>
                  </fieldset>
                  
               </td>
            </tr>     
           </logic:equal>
		   <logic:equal name="haform" property="showPreferences" value="false">
            <tr>
               <td colspan="3">&nbsp;</td>
            </tr> 
            <tr>
               <td colspan="3">&nbsp;</td>
            </tr>                        		   
            <tr>
	           <td align="left" class="description-small">           
					<p>This site is aimed to make you more familiarize various concepts by iterative process. You may attempt a particular concept(s) OR switch
					   concepts as many times as you can. At the end you may verify your scores by clicking the 'see' link under the Score tab.</p>

	           		<p>If you have any comments or suggestions, please use the link at the bottom right hand corner to send your feedback.</p>
	           		<p>Your feedback is appreciated in order this site to be improved further</p>
	
	           </td>
            </tr>  
            <tr>
               <td colspan="3">&nbsp;</td>
            </tr> 
            <tr>
	           <td align="left" class="description-small">
		           	<p>Please note </p>
		           	<ol>
		           		<li>Certain features are still under development. Your patience is appreciated.</li>
		           		<li>Content to be added to every feature.</li>
		           		<li>Enter key does not work most of the pages.</li>
		           	</ol>	           
	           </td>
            </tr> 
            </logic:equal>
                       
		</table>
		</div>
    </html:form>		

